package org.tib.concurrent;

import java.util.concurrent.Callable;

/**
 * A template to execute different tasks that supports concurrent execution.
 *
 * @author Imran
 */
public abstract class Processor<V,R> implements Callable<R> {

    public abstract R executeTask() throws ConcurrentException;

    public R call() throws ConcurrentException {
        return executeTask();
    }

    public V getParam() throws ConcurrentException {
        throw new ConcurrentException("Method not implemented");
    }

    public abstract void setParam(V param);
}
